﻿@{
	Layout = "~/Views/Shared/_Layout.cshtml";
	ViewBag.Title = "聊天室";
}

<div class="row">
	<div class="col-lg-offset-1 col-md-10 panel panel-primary" style="min-height:150px;">
		<div class="panel-heading">聊天室</div>
		<div class="panel-body">
			<div data-bind="foreach:messages">
				<div data-bind="text:$data"></div>
				<hr />
			</div>
		</div>
	</div>
</div>
<div class="row">
	<div class="col-lg-offset-6 col-lg-4">
		<div class="input-group">
			<input type="text" data-bind="value:message" placeholder="在此输入消息" class="form-control" id="msg"/>
			<span class="input-group-btn">
				<button type="button" data-bind="click:sendMessage" class="btn btn-primary" id="send">发送</button>
			</span>
		</div>
	</div>
</div>

<br />

<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery.signalR-2.2.0.js"></script>
<script src="~/SignalR/hubs"></script>
<script src="~/Scripts/knockout-3.3.0.js"></script>
<script src="~/Scripts/messageHub.js"></script>
<script>
	$("#send").click(function () {
		$("#msg").focus();
	})
</script>
